﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="DeletePreferences.aspx.cs" Inherits="cs499.Preferences.DeletePreferences" %>
<%@ MasterType VirtualPath="~/Site.Master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="NavOptions" runat="server">
    <asp:Button ID="CancelButton" runat="server" Text="Cancel" Width="133px" CausesValidation="False" PostBackUrl="~/Preferences/ListPreferences.aspx" />
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="FeaturedContent" runat="server">
    <section class="featured">
        <div class="content-wrapper">
            <h3>List of Preferences</h3>
        </div>
    </section>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="MainContent" runat="server">
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="ObjectDataSource1" DataKeyNames="Id" >
        <Columns>
            <asp:CommandField ShowDeleteButton="True"  />
            <asp:BoundField DataField="Course" HeaderText="Course" SortExpression="Course" />
            <asp:BoundField DataField="Room" HeaderText="Room" SortExpression="Room" />
            <asp:BoundField DataField="TimeSlot" HeaderText="TimeSlot" SortExpression="TimeSlot" />
        </Columns>
    </asp:GridView>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetPreferences" TypeName="cs499.Database.Faculty" DeleteMethod="DeletePreference" DataObjectTypeName="cs499.Database.CourseInstance">
        <SelectParameters>
            <asp:SessionParameter DefaultValue="-1" Name="departmentid" SessionField="CurrentDepartmentId" Type="Int32" />
            <asp:Parameter DefaultValue="-1" Name="facultyid" Type="Int32" />
            <asp:Parameter DefaultValue="" Name="UserName" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    
</asp:Content>
